//logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    logs: []
  },
  onLoad: function () {
      wx.request({
          url: 'http://test-in.in66.com/api/payment/signature?payment_channel=weapppay&business_party=activitycenter&order_detail=eyJvcmRlcl9ubyI6MTAwMzIxLCJzdWJqZWN0IjoiMTBcdTk0YmJcdTc3ZjMiLCJhbW91bnQiOjAuMDEsInByb2R1Y3RfaWQiOiJUZXN0MTAwMTAxMDIiLCJpc19leHBlbmRhYmxlIjoidHJ1ZSJ9&_token=873de863f702b4703793fbf7d4f08fdc',
          data: {
              extend_params: JSON.stringify({open_id:'def'})
          },
          success: function(e) {
            console.log(e)
          }
      })
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
  }
})
